<div class="doc-item" id="doc-1438"><h2 class="doc-item-name">update-values<span class="namespace">(clojure.contrib.sql)</span></h2><ul class="var-arglists"><li>(<span class="var-name">update-values</span> table where-params record)</li></ul><div class="var-docstring"><p>Updates values on selected rows in a table. where-params is a vector
  containing a string providing the (optionally parameterized) selection
  criteria followed by values for any parameters. record is a map from
  strings or keywords (identifying columns) to updated values.</p></div><div class="var-source"><pre>; clojure/contrib/sql.clj:166
(defn update-values
  [table where-params record]
  (let [[where &amp; params] where-params
        column-strs (map as-str (keys record))
        columns (apply str (concat (interpose &quot;=?, &quot; column-strs) &quot;=?&quot;))]
    (do-prepared
     (format &quot;UPDATE %s SET %s WHERE %s&quot;
             (as-str table) columns where)
     (concat (vals record) params))))</pre></div><div class="license"><p>Copyright (c) Rich Hickey. All rights reserved.</p><p>The use and distribution terms for this software are covered by the <a href="http://opensource.org/licenses/eclipse-1.0.php">Eclipse Public License 1.0</a>, which can be found in the file
          epl-v10.html at the root of this distribution. By using this software
          in any fashion, you are agreeing to be bound by the terms of this
          license. You must not remove this notice, or any other, from this
          software.</p></div></div>